package com.hdaccp.letting1.controller;
import com.alibaba.dubbo.config.annotation.Reference;
import com.hdaccp.letting1.entity.Userinfo;
import com.hdaccp.letting1.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Controller
@RequestMapping("/user")
public class UserInfoController {
    @Reference( interfaceName="com.hdaccp.letting1.service.UserInfoService")
    //@Resource
    private UserInfoService userInfoService ;
    @RequestMapping("/query")
    @ResponseBody
    public List<Userinfo> query() {
        return userInfoService.queryAll() ;
    }
    @RequestMapping("/query1")
    @ResponseBody
    public List<String> query1() {
        List<String> list = new ArrayList<>();
        list.add("aa") ;
        list.add("bb") ;
        return list ;
    }
}
